package com.example.administrator.baikangxing.activity;

import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.baikangxing.R;
import com.example.administrator.baikangxing.bean.ContactUser;
import com.example.administrator.baikangxing.config.Constants;

public class MessageActivity extends BaseActivity implements View.OnClickListener {
    private ImageView message_head;
    private TextView message_number, message_name, send_text, send_video, send_voice;
    private ContactUser user;

    @Override
    public int getContentViewLayoutId() {
        return R.layout.activity_message;
    }

    @Override
    public void initView() {
        setTitles("详细资料");
        base_ib_menu.setVisibility(View.INVISIBLE);
        message_number = findView(R.id.message_tv_phone_number);
        message_name = findView(R.id.message_tv_name);
        message_head = findView(R.id.message_iv_head);
        send_text = findView(R.id.message_tv_send_text);
        send_video = findView(R.id.message_tv_send_video);
        send_voice = findView(R.id.message_tv_send_voice);
        send_text.setOnClickListener(this);
        send_video.setOnClickListener(this);
        send_voice.setOnClickListener(this);
    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {
        Intent intent = getIntent();
        user = (ContactUser) intent.getSerializableExtra(Constants.USER_INFO);
        message_number.setText(user.getNumber());
        message_name.setText(user.getName());
        message_head.setImageResource(user.getPic());
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.message_tv_send_text://发送消息
                break;
            case R.id.message_tv_send_video://发送视频
                Intent intentVideoView = new Intent(this, VideoActivity.class);
                intentVideoView.putExtra("mIncomingCall",true);
                intentVideoView.putExtra("serial", user.getNumber());
                startActivity(intentVideoView);
                break;
            case R.id.message_tv_send_voice://发送语音
                break;
            default:
                break;
        }
    }
}
